#pragma GCC optimize(2, "Ofast", "inline")
#include <iostream>
#include <vector>
#include <map>
#include <cmath>
#include <set>
#include <queue>
#include <stack>
#include <list>
#include <unordered_map>
#include <algorithm>
#define endl '\n'
#define int long long
#define pii pair<int, int>
using namespace std;

// 已知
int n, m;
int a[111];
int b[111];
bool f[111];
// 未知

signed main()
{
    cin.tie(0)->sync_with_stdio(0);
    cout.tie(0);
    cin >> n >> m;
    for (int i = 0;i < n;i++) cin >> a[i];
    for (int i = 0;i < m;i++) cin >> b[i];
    sort(b, b + m);
    int i = 0, j = 0;
    while (i < n and j < m)
    {
        while (a[i] < b[j] and i < n)
        {
            i++;
        }
        if (a[i] == b[j]) f[i++] = 1;
        j++;
    }
    for (int i = 0;i < n;++i)
    {
        if (f[i] == 0) cout << a[i] << ' ';
    }


    return 0;
}